package com.at.abc.r420_ak;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class c {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solve();
        out.flush();
        out.close();
        br.close();
    }

    static void solve() throws IOException {
        String[] in = br.readLine().split(" ");
        int n = Integer.parseInt(in[0]);
        long q = Long.parseLong(in[1]);
        long[] a = new long[n];
        long[] b = new long[n];
        in = br.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(in[i]);
        }
        long ans = 0;
        in = br.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            b[i] = Long.parseLong(in[i]);
            ans += Math.min(a[i], b[i]);
        }
        while (q-- > 0) {
            in = br.readLine().split(" ");
            String c = in[0];
            int x = Integer.parseInt(in[1]) - 1;
            long v = Long.parseLong(in[2]);
            ans -= Math.min(a[x], b[x]);
            if (c.equals("A")) {
                a[x] = v;
            } else if (c.equals("B")) {
                b[x] = v;
            }
            ans += Math.min(a[x], b[x]);
            out.println(ans);
        }
    }
}
